/*
 * fv3
 * Copyright (C) 2012, John Pritchard, all rights reserved.
 * 
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see
 * <http://www.gnu.org/licenses/>.
 */
package fv3.model;


/**
 * An exception containing a model can be used for debugging the
 * construction of a larger model by showing a problematic part.
 */
public class Debugger
    extends IllegalStateException
{

    public final Model model;


    public Debugger(String m, fv3.Model.Element... model){
        super(m);
        if (null != model && 0 < model.length){

            this.model = new Model();

            for (fv3.Model.Element object: model){

                this.model.add(object);
            }
        }
        else
            throw new IllegalArgumentException();
    }
}
